<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/layout/contentLayout.xhtml">

	<ui:param name="param_pageTitle" value="订单信息" />
	<ui:param name="param_navigationUrl"
		value="/luyuan/sale/layout/navigationSale.jsf" />

	<ui:define name="road">
		<span>订单信息</span>
	</ui:define>
	<!-- content -->
	<ui:define name="content">
		<rg:areaPanel id="orderViewInfo">
			<rg:titlePanel id="orderInfo" headerTitle="订单信息">
				<rg:fieldSet column="double">
					<rg:outputText label="订单号"
						value="#{orderViewAction.order.id}" id="num" />
					<rg:outputText label="订单状态"
						value="#{orderViewAction.order.orderStatus}" converter="#{orderStatusConverter}"
						id="status" />
					<rg:outputText label="制单人"
						value="#{orderViewAction.order.saleman.userName}" id="userName" />
					<rg:outputText label="制单时间"
						value="#{orderViewAction.order.createTime}" id="createTime" 
							datePattern="yyyy-MM-dd HH:mm" converter="#{dateConverter}" />
					<rg:outputText label="订单类型"
						value="#{orderViewAction.order.orderType}" converter="#{orderTypeConverter}"
						id="orderType" />
					<rg:outputText label="付款方式"
						value="#{orderViewAction.order.paymentType}" converter="#{paymentTypeConverter}"
						id="payMethod" />
					<rg:outputText label="原价"
						value="#{orderViewAction.order.oldAmount}" id="oldAmount" />
					<rg:outputText label="特价" value="#{orderViewAction.order.amount}"
						id="amount" />
					<rg:outputText label="备注" singleLine="true"
						value="#{orderViewAction.order.remarks}" id="remarks" />
				</rg:fieldSet>
			</rg:titlePanel>
			<rg:titlePanel id="deliveryInfo" headerTitle="快递信息" style="margin-top:10px;">
				<rg:fieldSet column="double">
					<rg:outputText label="购买会员"
						value="#{orderViewAction.order.customer.name}" id="name" />
					<rg:outputText label="会员电话"
						value="#{orderViewAction.order.customer.mobile}" id="mobile" />
					<rg:outputText label="收货人"
						value="#{orderViewAction.order.delivery.receiver}" id="receiver" />
					<rg:outputText label="收货人电话"
						value="#{orderViewAction.order.delivery.deliveryPhone}" id="deliveryPhone" />
					<rg:outputText label="快递方式" 
						value="#{orderViewAction.order.delivery.expressCompany}" converter="#{expressCompanyConverter}" />
					<rg:outputText label="发货单号"
						value="#{orderViewAction.order.delivery.deliveryNumber}" id="shipNum" />
					<rg:outputText label="收货地址" singleLine="true"
						value="#{orderViewAction.order.delivery.deliveryAddress.getAddress()}" id="shipAddress" />
				</rg:fieldSet>
			</rg:titlePanel>
			<rg:titlePanel id="productInfo" headerTitle="产品信息">
				<rg:table id="productTable" pagination="disable" pageSize="1"
					value="#{orderViewAction.productTableModel}" var="item">
					<rg:column property="product.productType.typeName"
						title="产品类型" width="100" />
					<rg:column property="name" title="产品名称" width="100" />
					<rg:column property="specification" title="产品规格"
						width="100" />
					<rg:column property="price" title="产品价格" width="100" />
					<rg:column title="数量" width="100" >
						<h:outputLabel value="#{item.count + item.gifts}" />
					</rg:column>
					<rg:column title="小计" property="subTotal" width="100" />
					<rg:column title="促销" width="100" >
						<h:outputLabel value="赠品" rendered="#{item.gift}"/>
						<h:outputLabel value="其中赠送：#{item.gifts}" rendered="#{item.gifts gt 0}"/>
						<h:outputLabel value="积分兑换：#{item.exchangeIntegral}" rendered="#{item.exchangeIntegral ne 0}"/>
					</rg:column>
				</rg:table>
			</rg:titlePanel>
			<rg:titlePanel id="orderFormula" headerTitle="配方信息" rendered="#{orderViewAction.isFormula()}">
			     <rg:fieldSet column="single">
			         <rg:outputText label="执行天数" value="#{orderViewAction.orderFormula.days}" id="days" />
			         <rg:outputText label="临早餐前" value="#{orderViewAction.orderFormula.beforeBreakfast}" id="beforeBreakfast" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="早餐后" value="#{orderViewAction.orderFormula.afterBreakfast}" id="afterBreakfast" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="临午餐前" value="#{orderViewAction.orderFormula.beforeLunch}" id="beforeLunch" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="午餐后" value="#{orderViewAction.orderFormula.afterLunch}" id="afterLunch" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="临晚餐前" value="#{orderViewAction.orderFormula.beforeDinner}" id="beforeDinner" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="晚餐后" value="#{orderViewAction.orderFormula.afterDinner}" id="afterDinner" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="临睡前" value="#{orderViewAction.orderFormula.beforeSleep}" id="beforeSleep" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="原药单" value="#{orderViewAction.orderFormula.oldDrugBill}" id="oldDrugBill" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="客户要求" value="#{orderViewAction.orderFormula.customerRequire}" id="customerRequire" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="配方作用" value="#{orderViewAction.orderFormula.purpose}" id="purpose" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="生活注意事项" value="#{orderViewAction.orderFormula.lifeNote}" id="lifeNote" 
			         	escape="false"  converter="#{htmlConverter}"/>
			         <rg:outputText label="备注" value="#{orderViewAction.orderFormula.remarks}" id="orderFormulaRemarks" 
			         	escape="false"  converter="#{htmlConverter}"/>
			     </rg:fieldSet>
			</rg:titlePanel>
			<rg:titlePanel id="recordInfo" headerTitle="操作记录">
				<rg:table id="orderRecordTable" pagination="disable" pageSize="1"
					value="#{orderViewAction.orderRecordTableModel}" var="item">
					<rg:column property="operator.userName" title="操作员" width="100" />
					<rg:column property="operator.appUser.roles" converter="#{roleConverter}"  title="操作员角色" width="100" />
					<rg:column property="operation" title="操作记录" width="100" />
					<rg:column property="operateTime" title="操作时间" width="100" />
					<rg:column property="remarks" title="备注" width="100" />
				</rg:table>
			</rg:titlePanel>
			<h:panelGroup styleClass="panelButton" layout="block"
				style="text-align:center;">
				<h:form>
					<ui:insert name="bottomButton" />
				</h:form>
			</h:panelGroup>
		</rg:areaPanel>
	</ui:define>
</ui:composition>